﻿using System;
using System.ComponentModel;
using System.Reflection;
using Newtonsoft.Json.Converters;

namespace Learun.Util
{
    /// <summary>
    /// 允许字段为空保存
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
    public class NullValueAttribute : Attribute
    {


    }

    /// <summary> 
    /// 隐藏接口，不生成到swagger文档展示 
    /// 注意：如果不加[HiddenApi]标记的接口名称和加过标记的隐藏接口名称相同，则该普通接口也会被隐藏不显示，所以建议接口名称最好不要重复
    /// </summary> 
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
    public partial class HiddenApiAttribute : Attribute { }

    /// <summary>
    /// 
    /// </summary>
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
    public partial class TokenAuthorizeAttribute : Attribute { }

    public class DateFormatConverter : IsoDateTimeConverter
    {
        public DateFormatConverter(string format)
        {
            DateTimeFormat = format;
        }
    }
}
